﻿using System.Collections.Generic;
using System.Threading.Tasks;
using BCCommon.TMS.Driver;
using BCEntity.TMS.Driver.DriverLearnDatum;

namespace BCData.TMS.Driver.DriverLearnDatum
{
    public interface IDriverLearnDatumData
    {
        /// <summary>
        /// 新增一个学习资料信息
        /// </summary>
        /// <param name="entity">学习资料信息</param>
        /// <returns></returns>
        Task<DriverLearnDatumEntity> InsertAsync(DriverLearnDatumEntity entity);
        /// <summary>
        /// 删除一个学习资料信息
        /// </summary>
        /// <param name="DatumId">学习资料Id</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int DatumId);
        /// <summary>
        /// 获取一条指定的学习资料
        /// </summary>
        /// <param name="DatumId">学习资料Id</param>
        /// <returns></returns>
        Task<DriverLearnDatumEntity> GetDriverLearnDatumByIdAsync(int DatumId);
        /// <summary>
        /// 分页获取司机学习资料
        /// </summary>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <param name="appliedTo">适用业务类型</param>
        /// <returns></returns>
        Task<(IEnumerable<DriverLearnDatumEntity>, int)> GetDriverLearnDatumsAsync(string datumTopic, string answerContent,
            DriverRoleType? appliedTo, int pageIndex, int pageSize);
        /// <summary>
        /// 检查学习资料
        /// </summary>
        /// <param name="DatumId">学习资料Id</param>
        /// <returns></returns>
        Task<bool> CheckExistsByIdAsync(int DatumId);
    }
}
